<%
option explicit
%>
<!--#include file="../common/conn.asp"-->
<!--#include file="../common/func.asp"-->
<%
dim id
table="student"
preColumn=left(table,3)
dim cname,address,info,offer,email,tags,mdate
id=request.Form("id")
cname=request.Form("stu_name")
address=request.Form("stu_address")
info=request.Form("stu_info")
offer=request.Form("stu_offer")
email=request.Form("stu_email")
tags=request.Form("stu_tags")
mdate=now()
if id<>"" then
id=checkint(id)
sql="select * from ["&table&"] where "&preColumn&"_id="&id
rs.open sql,conn,2,3
else
sql="select * from ["&table&"] where "&preColumn&"_id=-1"
rs.open sql,conn,2,3
rs.addnew
end if
rs(preColumn&"_name")=cname
rs(preColumn&"_address")=address
rs(preColumn&"_info")=info
rs(preColumn&"_offer")=offer
rs(preColumn&"_email")=email
rs(preColumn&"_tags")=tags
rs(preColumn&"_date")=mdate
rs.update
connclose
%>
